window.onload=function () {
    /*初始化导航菜单*/
    initNavs();
}

function initNavs() {

    var nav = document.getElementById('nav');
    for (var key in items) {
        var listItem = document.createElement('li');
        listItem.innerText = items[key].title;
        var uList = document.createElement('ul');
        listItem.appendChild(uList);
        for(var key2 in items[key].children){
            var listItem2 = document.createElement('li');
            listItem2.innerText = items[key].children[key2].title;
            uList.appendChild(listItem2);
        }
        nav.appendChild(listItem);

    }

}